﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IO;

/// <summary>
/// WriteToLog 的摘要说明
/// </summary>
public class WriteToLog
{
	public WriteToLog()
	{
		//
		// TODO: 在此处添加构造函数逻辑
		//
	}
    public static void SaveToLog(string strLine)
    {
        try
        {
            string strFilePath = "c:\\SvrLog\\" + DateTime.Now.ToString("yyyyMMdd");
            DirectoryInfo dir = new DirectoryInfo(strFilePath);
            if (!dir.Exists)
                dir.Create();
            StreamWriter sw = new StreamWriter(strFilePath + "\\Log" + DateTime.Now.ToString("yyyyMMdd") + ".txt", true, System.Text.Encoding.Default);
            sw.WriteLine(strLine + "  " + DateTime.Now.ToString());
            sw.Close();
        }
        catch
        {
        }
    }
}